﻿using UsersManagement;
using Volo.Abp.Modularity;
using Xms.Abp.Modularity;
using Xms.Abp.Storage.DependencyInjection;

namespace IdentityManagement
{
    [DependsOn(
        typeof(IdentityManagementDomainModule), 
        typeof(UsersManagementStorageModule))]
    public class IdentityManagementStorageModule : XmsModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddStorage<IdentityManagementStorage>(
                IdentityManagementDbProperties.DbTablePrefix,
                IdentityManagementDbProperties.DbSchema,
                options =>
                {
                    options.AddRepository<IdentityUser, IdentityUserRepository>();
                    options.AddRepository<IdentityRole, IdentityRoleRepository>();
                    options.AddRepository<IdentityClaimType, IdentityClaimTypeRepository>();
                    options.AddRepository<OrganizationUnit, OrganizationUnitRepository>();
                    options.AddRepository<IdentitySecurityLog, IdentitySecurityLogRepository>();
                    options.AddRepository<IdentityLinkUser, IdentityLinkUserRepository>();
                });
        }
    }
}
